﻿// -----------------------------------------------------------------------
//  <copyright file="IFilterValueProvider.cs" company="LiuliuSoft">
//      Copyright (c) 2025 66SOFT. All rights reserved.
//  </copyright>
//  <site>https://ifs.66soft.net</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025-10-23 23:10</last-date>
// -----------------------------------------------------------------------

namespace DaprPlus.Filters;

/// <summary>
/// 过滤器动态值提供者接口
/// </summary>
public interface IFilterValueProvider
{
    /// <summary>
    /// 获取支持的标记前缀
    /// </summary>
    string Prefix { get; }

    /// <summary>
    /// 检查是否支持指定的标记
    /// </summary>
    /// <param name="token">标记</param>
    /// <returns></returns>
    bool CanHandle(string token);

    /// <summary>
    /// 获取动态值
    /// </summary>
    /// <param name="token">标记</param>
    /// <param name="targetType">目标类型</param>
    /// <returns>动态值</returns>
    object? GetValue(string token, Type targetType);
}